//
//  FDMTopCollectionReusableViewHeader.m
//  Entertainment
//
//  Created by dllo on 16/4/25.
//  Copyright © 2016年 付冬梅. All rights reserved.
//

#import "FDMTopCollectionReusableViewHeader.h"
#import "FDMTopRadioWheelModel.h"

@interface FDMTopCollectionReusableViewHeader ()

@property (nonatomic, retain) FDMBaseButton *topHeaderImage;

@end
@implementation FDMTopCollectionReusableViewHeader

- (instancetype)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.topHeaderImage = [FDMBaseButton buttonWithType:UIButtonTypeCustom];
        [self addSubview:self.topHeaderImage];
        
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes {
    [super applyLayoutAttributes:layoutAttributes];
    self.topHeaderImage.frame = self.frame;
}

- (void)dealloc {
    [self.topHeaderImage release];
    [super dealloc];
}

- (void)setHeaderImageModel:(FDMTopRadioWheelModel *)headerImageModel {
    if (_headerImageModel != headerImageModel) {
        [_headerImageModel release];
        _headerImageModel = [headerImageModel retain];
        [self.topHeaderImage sd_setBackgroundImageWithURL:[NSURL URLWithString:_headerImageModel.pic] forState:UIControlStateNormal placeholderImage:PLACEHOLDER_IMAGE];
    }
}

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
